//
//  ReminderWebController.m
//  LuCaiZhu
//
//  Created by stella Ma on 2018/8/7.
//
#import "CKPuslichTool.h"

#import "ReminderWebController.h"

@interface ReminderWebController ()
@property (weak, nonatomic) IBOutlet UIView *whiteBg;
@property (weak, nonatomic) IBOutlet UIWebView *mWebView;
@end

@implementation ReminderWebController

- (void)viewDidLoad {
    [super viewDidLoad];
//
    
//    NSLog(@"原url:%@", _filePath);
//    NSString *encodedString = (NSString *) CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)_filePath, (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]", NULL, kCFStringEncodingUTF8));
//   NSLog(@"转码url000:%@", encodedString);
//   NSString *uuuu = [_filePath stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
//    NSLog(@"转码url:%@", uuuu);
    
    [[NSURLCache sharedURLCache] removeAllCachedResponses];
    self.view.backgroundColor =[UIColor colorWithWhite:0 alpha:0.4];
    _mWebView.backgroundColor =[UIColor clearColor];
    NSString *enString=[_filePath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
    UIViewSetRadius(_whiteBg, 10, 0, nil);
    
    [_mWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:enString]]];
}
- (IBAction)cancel:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)webViewDidFinishLoad:(UIWebView *)webView{
    NSLog(@"webViewDidFinishLoad");
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
    NSLog(@"error--%@",error.description);
}

@end
